package pack0827;

public class StuInfo implements Comparable{
    private Integer stuId;
    private String stuName;
    private Integer stuAge;
    public StuInfo(){

    }

    public StuInfo(Integer stuId,String stuName,Integer stuAge){
        this.stuAge = stuAge;
        this.stuName = stuName;
        this.stuId = stuId;
    }

    public Integer getStuId() {
        return stuId;
    }

    public void setStuId(Integer stuId) {
        this.stuId = stuId;
    }

    public String getStuName() {
        return stuName;
    }

    public void setStuName(String stuName) {
        this.stuName = stuName;
    }

    public Integer getStuAge() {
        return stuAge;
    }

    public void setStuAge(Integer stuAge) {
        this.stuAge = stuAge;
    }

    @Override
    public int compareTo(Object o) {
        //return this.getStuAge()-((StuInfo)o).getStuAge();
        char c1 = this.getStuName().charAt(0);
        char c2 = ((StuInfo)o).getStuName().charAt(0);
        return c1-c2;
    }

    @Override
    public String toString() {
        return "StuInfo{" +
                "stuId=" + stuId +
                ", stuName='" + stuName + '\'' +
                ", stuAge=" + stuAge +
                '}';
    }
}
